package com.example.tiku2;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

import com.example.tiku2.bean.ProjectBean;

import java.util.ArrayList;

public class MyBroadcastService extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String title = intent.getStringExtra("title");
        Toast.makeText(context, title, Toast.LENGTH_SHORT).show();

        ArrayList<ProjectBean.DataBean.DatasBean> list =
                (ArrayList<ProjectBean.DataBean.DatasBean>) intent.getSerializableExtra("list");

        Intent it = new Intent(context, Main2Activity.class);
        it.putExtra("list", list);
        it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//创建新栈存放启动的Main2Acitivy
        context.startActivity(it);
    }
}
